#include "StdAfx.h"
#include "RuleStrength.h"
#include "Datamanager.h"

CRuleStrength::CRuleStrength(void)
{
}


CRuleStrength::~CRuleStrength(void)
{
}

bool CRuleStrength::BuySign(PER_DATA* pData)
{
	if (pData->preData == NULL){
		return false;
	}

	if (	pData->AvData[EAV_10] ==NULL
		||	pData->AvData[EAV_20] ==NULL
		||	pData->AvData[EAV_30] ==NULL)
	{
		return false;
	}

	bool bRet = (	pData->AvData[EAV_10]  - pData->preData->AvData[EAV_10] > 0.00001
				&&	pData->AvData[EAV_30]  - pData->preData->AvData[EAV_30] > 0.00001
				&&	pData->AvData[EAV_20]  - pData->preData->AvData[EAV_20] > 0.00001
				);

	return bRet;
}

bool CRuleStrength::SellSign(PER_DATA* pData)
{
	if (!pData->preData){
		return false;
	}
	if (	pData->AvData[EAV_10] ==NULL
		||	pData->AvData[EAV_20] ==NULL
		||	pData->AvData[EAV_30] ==NULL)
	{
		return false;
	}

	bool bRet = (	pData->AvData[EAV_10]  - pData->preData->AvData[EAV_10] < -0.00001
				&&	pData->AvData[EAV_30]  - pData->preData->AvData[EAV_30] < -0.00001
				&&	pData->AvData[EAV_20]  - pData->preData->AvData[EAV_20] < -0.00001);
	
	return bRet;
}